package redisCache

import (
	"time"
)

type RedisCache interface {
	// key/锁是否存在
	Exist(key string) (bool, error)

	// 添加缓存
	CacheAdd(key string, value interface{}, cacheTtl, lockTtl time.Duration, requestId int) error
	// 添加多条缓存
	CacheAddMultiple(cache map[string]interface{}, cacheTtl, lockTtl time.Duration, requestId int) (err error)
	// 删除缓存
	CacheDel(key string) error
	// 获取单条缓存
	CacheGet(key string) (result []byte, err error)
	// 获取多条缓存
	CacheGetMultiple(keys []string) (value [][]byte, err error)

	// 添加哈希缓存
	HashCacheAddMultiple(key string, value map[string]interface{}, cacheTtl, lockTtl time.Duration, requestId int) (err error)
	// 获取哈希所有key
	HashCacheGetAllKey(key string) (keyExist bool, result []string, err error)
	// 获取哈希单条key,返回key是否存在
	HashCacheGet(key, hashKey string) (keyExist bool, result []byte, err error)
	// 获取哈希所有键值对
	HashGetAll(key string) (result map[string]string, err error)
}
